/*引入通用html********/

//头部 + 左侧菜单栏
var header = `

  <div class="layui-header header header-demo">

    <!-- 头部-左侧内容-logo -->
    <div class="layui-logo">
      <img src="../../images/logo.png" alt="logo">&nbsp;家装公司后台
    </div>

    <!-- 头部-左侧内容-收缩菜单栏图标 -->
    <ul class="layui-nav layui-layout-left">
      <li>
        <a id="shrink" data-side="show" style="cursor: pointer">
          <img src="../../images/shrink.png" alt="收缩">
        </a>
      </li>
    </ul>

    <!-- 头部-右侧内容-头像/退出 -->
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item ">
        <a href="javascript:;">
          <img src="../../images/choose.png" class="layui-nav-img">
          admin
        </a>
        <dl id="userInfo" class="layui-nav-child">
          <dd>
            <a lay-id="user" href="../10_user/user.html">
              <i class="layui-icon">&#xe614;</i><cite>个人资料<cite>
            </a>
          </dd>
          <dd>
            <a lay-id="user" href="../10_user/user.html">
              <i class="layui-icon">&#xe65e;</i><cite>我的账户<cite>
            </a>
          </dd>
        </dl>
      </li>
      <li class="layui-nav-item layui-hide-xs"><a href="">安全退出</a></li>
    </ul>
  </div>

  <!--左侧菜单栏-->
  <div class="layui-side layui-bg-black show">
    <div class="user-photo">
      <a class="img" title="我的头像"><img src="../../images/logo_wd.png" class="userAvatar"></a>
      <p>你好！<span class="userName">admin</span>, 欢迎登录</p>
    </div>
    <div class="layui-side-scroll">

      <ul class="layui-nav layui-nav-tree">

        <li class="layui-nav-item">
          <a lay-id="index" href="../index/index.html">
            <i class="layui-icon">&#xe68e;</i><cite>后台首页<cite>
          </a>
        </li>

        <li class="layui-nav-item">
          <a lay-id="yzbStore" href="../1_yzbStore/yzbStore.html">
            <i class="layui-icon">&#xe620;</i><cite>公司信息</cite>
          </a>
        </li>

        <li class="layui-nav-item">
          <a lay-id="yzbPlus" href="../2_plus/yzbPlus.html">
            <i class="layui-icon">&#xe630;</i><cite>装修套餐管理</cite>
          </a>
        </li>

        <li class="layui-nav-item layui-nav-itemed">
          <a href="javascript:;">
            <i class="layui-icon">&#xe698;</i><cite>主材商城</cite>
          </a>
          <dl class="layui-nav-child">
            <dd><a lay-id="yzbMaterials" href="../3_materials/yzbMaterials.html">优装宝主材馆</a></dd>
            <dd><a lay-id="yzbComMerchant" href="../3_materials/yzbComMerchant.html">我的自建供应商</a></dd>
            <dd><a lay-id="listPlus" href="../3_materials/listPlus.html">我的自建主材</a></dd>
          </dl>
        </li>

        <li class="layui-nav-item layui-nav-itemed">
          <a href="javascript:;">
            <i class="layui-icon">&#xe657;</i><cite>施工商城</cite>
          </a>
          <dl class="layui-nav-child">
            <dd><a lay-id="commonConstruction" href="../4_construction/commonConstruction.html">常规施工</a></dd>
            <dd><a lay-id="priceConstruction" href="../4_construction/priceConstruction.html">加减价施工</a></dd>
          </dl>
        </li>

        <li class="layui-nav-item">
          <a lay-id="yzbWorker" href="../5_workers/yzbWorker.html">
            <i class="layui-icon">&#xe612;</i><cite>公司员工管理</cite>
          </a>
        </li>

        <li class="layui-nav-item layui-nav-itemed">
          <a href="javascript:;">
            <i class="layui-icon">&#xe63c;</i><cite>订单管理</cite>
          </a>
          <dl class="layui-nav-child">
            <dd><a lay-id="yzbCompanyOrder" href="../6_order/yzbCompanyOrder.html">客户订单</a></dd>
            <dd><a lay-id="yzbPurchaseOrder" href="../6_order/yzbPurchaseOrder.html">采购订单</a></dd>
            <dd><a lay-id="listPurchase" href="../6_order/listPurchase.html">自由采购</a></dd>
          </dl>
        </li>

        <li class="layui-nav-item">
          <a lay-id="yzbHouse" href="../7_house/yzbHouse.html">
            <i class="layui-icon">&#xe631;</i><cite>客户工地管理</cite>
          </a>
        </li>

        <li class="layui-nav-item">
          <a lay-id="yzbCompanyCustom" href="../8_custom/yzbCompanyCustom.html">
            <i class="layui-icon">&#xe613;</i><cite>公司客户管理</cite>
          </a>
        </li>

        <li class="layui-nav-item">
          <a lay-id="yzbPlot" href="../9_plot/yzbPlot.html">
            <i class="layui-icon">&#xe715;</i><cite>小区管理</cite>
          </a>
        </li>

      </ul>
    </div>
  </div>

`;

//分页
var pageList = `
            <div class="layui-table-page">
              <div class="layui-box layui-laypage layui-laypage-default" id="laypage">
                <a href="javascript:;" class="layui-laypage-prev layui-disabled" data-page="0">
                  <i class="layui-icon">&#xe603;</i>
                </a>
                <span class="layui-laypage-curr">
                  <em class="layui-laypage-em layui-btn-gray"></em>
                  <em>1</em>
                </span>
                <a href="javascript:;" data-page="2">2</a>
                <a href="javascript:;" data-page="3">3</a>
                <span class="layui-laypage-spr">…</span>
                <a href="javascript:;" class="layui-laypage-last" title="尾页" data-page="100">100</a>
                <a href="javascript:;" class="layui-laypage-next" data-page="2">
                  <i class="layui-icon">&#xe602;</i>
                </a>
                <span class="layui-laypage-skip">
                  到第
                  <input type="text" min="1" value="1" class="layui-input">
                  页
                  <button type="button" class="layui-laypage-btn">确定</button>
                </span>
                <span class="layui-laypage-count">共 1000 条</span>
                <span class="layui-laypage-limits">
                  <select lay-ignore="">
                    <option value="10" selected="">10 条/页</option>
                    <option value="20">20 条/页</option>
                    <option value="30">30 条/页</option>
                    <option value="40">40 条/页</option>
                    <option value="50">50 条/页</option>
                    <option value="60">60 条/页</option>
                    <option value="70">70 条/页</option>
                    <option value="80">80 条/页</option>
                    <option value="90">90 条/页</option>
                  </select>
                </span>
              </div>
            </div>
`;

var footer = `
  <div class="layui-footer">
    http://yzb.yyzzbb.com © 2017-2027
  </div>
`;

var comHeader = document.getElementById("header");
var comFooter = document.getElementById("footer");
var comPageList = document.getElementById("pageList");
var comPageList1 = document.getElementById("pageList1");
var comPageList2 = document.getElementById("pageList2");
var comPageList3 = document.getElementById("pageList3");
var comPageList4 = document.getElementById("pageList4");

if(comHeader){
  comHeader.innerHTML = header;
}
if(comFooter){
  comFooter.innerHTML = footer;
}
if(comPageList){
  comPageList.innerHTML = pageList;
}
if(comPageList1){
  comPageList1.innerHTML = pageList;
}
if(comPageList2){
  comPageList2.innerHTML = pageList;
}
if(comPageList3){
  comPageList3.innerHTML = pageList;
}
if(comPageList4){
  comPageList4.innerHTML = pageList;
}
/******************/
